package com.cqw.commontest.compare.comparable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-11-02 15:34
 * @Description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Dog implements Comparable<Dog> {

    private String name;

    private int age;

    @Override
    public int compareTo(Dog o) {
        return this.age - o.getAge();
    }
}
